package com.tongtech.space.common.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 实体类公共字段
 *
 * @author jinjiayu
 * @since 2021/1/14
 */
@Data
public class BaseEntity {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("id")
    protected Integer id;

    @ApiModelProperty(hidden = true)
    @TableField(fill = FieldFill.INSERT)
    protected LocalDateTime createdTime;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    protected Integer createdId;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    protected String createdName;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected LocalDateTime updatedTime;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected Integer updatedId;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected String updatedName;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    @TableLogic(value="0",delval="1")
    protected Integer logicDelete = 0;

}
